#include <stdio.h>
#include <stdlib.h>
 
typedef char ElemType;
 
typedef struct LNode {
    ElemType data;
    struct LNode *next;        
} LinkNode;                     
void CreateListR(LinkNode *&L, ElemType a[], int n);
void DispList(LinkNode *L);
void Split(LinkNode *&L, ElemType x);
 
int main()
{
    int n;
    scanf("%d", &n);
 
    ElemType a[n];
    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i]);
    }
 
    LinkNode *L;
    CreateListR(L, a, n);
    printf("L:"); DispList(L);
 
    ElemType x;
    scanf("%d", &x);
 
    printf("以%d进行划分\n", x);
    Split(L, x);
    printf("L:"); DispList(L);
 
    return 0;
}
 